<template>
	<view class="user">
		<view class="user-wrap">
			<view class="info">
				<image class="avatar" mode="aspectFill" :src="userInfo.headPicUrl"></image>
				<view class="nickname">{{ userInfo.nickName }}</view>
			</view>
		</view>

		<!-- 用户功能 -->
		<view class="com-item">
			<view class="com-wrap">
				<view class="cell" v-for="(item, index) in userList" :key="index">
					<navigator v-if="index==0" url="../Introduction/Introduction">
						<view class="cell-left">
							<image class="cell-icon" :src="item.icon" mode="aspectFill"></image>
							<view class="cell-text">{{ item.title }}</view>
						</view>
					</navigator>
					<navigator v-if="index==1" url="../feedback/feedback">
						<view class="cell-left" >
							<image class="cell-icon" :src="item.icon" mode="aspectFill"></image>
							<view class="cell-text">{{ item.title }}</view>
						</view>
					</navigator>
					<view class="iconfont iconmore1"></view>
				</view>
			</view>
		</view>
		<view class="com-item">
			<view class="com-wrap">
				<view class="cell" v-for="(item, index) in serverList" :key="index">
					<navigator v-if="index==0" url="../seting/seting">
						<view class="cell-left">
							<image class="cell-icon" :src="item.icon" mode="aspectFill"></image>
							<view class="cell-text">{{ item.title }}</view>
						</view>
					</navigator>
					<navigator v-if="index==1" url="../login/login">
						<view class="cell-left">
							<image class="cell-icon" :src="item.icon" mode="aspectFill"></image>
							<view class="cell-text">{{ item.title }}</view>
						</view>
					</navigator>
					<view class="iconfont iconmore1"></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			userInfo: {
				headPicUrl: '/static/images/me.png',
				nickName: '多兰波给·相'
			},
			userList: [
				{
					title: '我的攻略',
					icon: '/static/images/user/gonglue.png',
					path: 'address-list'
				},
				{
					title: '反馈',
					icon: '/static/images/user/fankui.png',
					path: 'collect-list'
				},
			],
			serverList: [
				{
					title: '设置',
					icon: '/static/images/user/shezhi.png',
					path: 'kefu'
				},
				{
					title: '切换账号',
					icon: '/static/images/user/qiehuang.png',
					path: 'help'
				},
			]
		};
	},
	methods: {
		seting() {
			uni.navigateTo({
				url: '../seting/seting'
			})
		}
	}
};
</script>

<style lang="scss">
page {
	background: #f2f2f2;
}
.btn-hover {
	background: #f2f2f2 !important;
}
.user {
	.user-wrap {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 50vw;
		padding: 30rpx;
		z-index: 9;
		background: url(/static/images/pro-bg.jpg) no-repeat;
		background-size: cover;
		.info {
			position: absolute;
			text-align: center;
			.avatar {
				width: 150rpx;
				height: 150rpx;
				border-radius: 50%;
			}
			.nickname {
				color: #fff;
				font-size: 28rpx;
			}
		}
	}
	.com-item {
		padding-left: 20rpx;
		padding-right: 20rpx;
		margin-top: 20rpx;
		.com-wrap {
			border-radius: 25rpx;
			overflow: hidden;
		}
	}
	.cell {
		height: 80rpx;
		padding-left: 20rpx;
		padding-right: 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: #fff;
		border-bottom: 1px solid #f8f8f8;
		&:active {
			background: #f2f2f2;
		}
		&:last-child {
			border-bottom: none !important;
		}
		.cell-left {
			display: flex;
			align-items: center;
			.cell-icon {
				width: 50rpx;
				height: 50rpx;
			}
			.cell-text {
				color: #666;
				font-size: 28rpx;
				margin-left: 20rpx;
			}
		}
		.iconfont {
			font-size: 40rpx;
			color: #999;
		}
	}
}
</style>
